package com.itboye.ihomebank.adapter.fangyuan;

import java.util.List;

import com.itboye.ihomebank.R;
import com.itboye.ihomebank.bean.HouseZiDianBean.houseOrientation;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
/**
 * 楼房朝向
 *
 */
public class ChaoXiangAdapter extends BaseAdapter {
	Context context;
	List<houseOrientation> list; 
	
	public ChaoXiangAdapter(Context context,List<houseOrientation> list) {
		this.context=context;
		this.list=list;
	}
	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return list.size();
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return list.get(position);
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public View getView(int position, View view, ViewGroup parent) {
		ViewHolder holder;
		if(view==null){
			holder=new ViewHolder();
			view=LayoutInflater.from(context).inflate(R.layout.item_choose_area, null);
			holder.mNameTextView=(TextView) view.findViewById(R.id.name);
			
			view.setTag(holder);
		}else{
			holder=(ViewHolder) view.getTag();
		}
		holder.mNameTextView.setText(list.get(position).getName());
		
		
		return view;
	}
	private class ViewHolder {
		public TextView mNameTextView;
	}
}
